﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace OverredQQ.Demo
{
    public partial class Form1 : Form
    {

        OverredQQ.QQCore.QQClient client=null;

        public Form1()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                client = new OverredQQ.QQCore.QQClient();
                client.Login(Int32.Parse(this.txtNum.Text), txtPwd.Text,true,"sz.tencent.com",8000);
                MessageBox.Show("登录成功");

            }
            catch
            { }
        }

        /// <summary>
        /// 发送消息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLogout_Click(object sender, EventArgs e)
        {
            if (client != null)
            {
                client.Logout();
            }
        }


        /// <summary>
        /// 注销
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSend_Click(object sender, EventArgs e)
        {
            if (client != null)
            {
                client.SendNormalIM(41561268,"http://overred.cnblogs.com");
            }
        }
    }
}